package com.example.jack.community.view.me.personinfo;

import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.jack.community.R;
import com.example.jack.community.view.me.BlackStatusActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 更多界面
 */
public class Perfect_Per_info_aActivity extends BlackStatusActivity {

    //返回按钮
    @BindView(R.id.img_return)
    ImageView imgReturn;

    //返回文字
    @BindView(R.id.txt_return)
    TextView txtReturn;

    //修改个人信息
    @BindView(R.id.txt_mod)
    TextView txtMod;

    //学校信息
    @BindView(R.id.txt_school)
    TextView txtSchool;

    //性别信息
    @BindView(R.id.txt_sex)
    TextView txtSex;

    //名字信息
    @BindView(R.id.txt_name)
    TextView txtName;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.my_perfect__per_info_a);
        ButterKnife.bind(this);
        SharedPreferences sharedPreferences = getSharedPreferences("data", MODE_PRIVATE);
        String schoolName = sharedPreferences.getString("schoolName", "0");
        String studentName = sharedPreferences.getString("studentName", "0");
        String studentSex = sharedPreferences.getString("studentSex", "0");
//        editor.putString("schoolName", schoolName);
//        editor.putString("studentName", studentName);
//        editor.putString("studentSex", studentSex);
        if (!schoolName.equals("0") && !studentName.equals("0") && !studentSex.equals("0")) {
            txtSchool.setText(schoolName);
            txtName.setText(studentName);
            txtSex.setText(studentSex);
        }
    }

    @OnClick({R.id.img_return, R.id.txt_return, R.id.txt_mod})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.img_return:
                finish();
                break;
            case R.id.txt_return:
                finish();
                break;
            case R.id.txt_mod:
                startActivity(new Intent(Perfect_Per_info_aActivity.this, Perfect_Per_infoActivity.class));
                finish();
                break;
        }
    }


}
